Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial DB Domain Types #2

Merged
merged 2 commits into from
Sep 3, 2023
Merged

Initial DB Domain Types #2

merged 2 commits into from
Sep 3, 2023

Conversation

gbdubs
Copy link
Contributor

@gbdubs gbdubs commented Aug 31, 2023

This PR checks in the initial schema for the PACTA app, as described first in the requirements, and then in the Schema Review. It also checks in the first ~10 pieces of sqldb glue code to wire up + test our ability to persist and maniuplate the golang domain types. The first pieces chosen for this are first ones I need to implement the first piece of the site functionality, namely: managing initiative-user membership, which includes creating initiatives, users, invitations, and their acceptance flows.

@gbdubs gbdubs requested a review from bcspragu August 31, 2023 19:17
Copy link
Collaborator

@bcspragu bcspragu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, though with comments on a few general patterns that I think we should figure out before adding more entities:

  • Timestamp stuff (e.g. created_at populated automatically per schema, using CURRENT_TIMESTAMP, etc)
  • Using full domain structs for creation methods even when most fields are unused
  • exactlyOne and query versus queryRow when querying on primary keys
  • Using RunOrContinueTransaction in places with only a single SQL statement

db/db.go Show resolved Hide resolved
db/sqldb/blob.go Outdated Show resolved Hide resolved
db/sqldb/sqldb.go Show resolved Hide resolved
db/sqldb/blob.go Outdated Show resolved Hide resolved
db/sqldb/blob.go Outdated Show resolved Hide resolved
db/sqldb/initiative_user.go Show resolved Hide resolved
db/sqldb/migrations/0003_domain_types.up.sql Show resolved Hide resolved
db/sqldb/migrations/0003_domain_types.up.sql Show resolved Hide resolved
db/sqldb/migrations/0003_domain_types.up.sql Outdated Show resolved Hide resolved
db/sqldb/pacta_version.go Show resolved Hide resolved
@gbdubs gbdubs merged commit f9ff751 into main Sep 3, 2023
2 checks passed
gbdubs added a commit that referenced this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants